package com.bmft;

import com.bmft.runnable.BootNettyServerRunnable;
import com.bmft.server.BootNettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @Author Jarvan
 * @create 2020/9/1 14:29
 */
@SpringBootApplication
@EnableAsync
public class MPApplicaton_01 {
    public static void main(String[] args) {
        SpringApplication.run(MPApplicaton_01.class,args);
        //异步执行方法
        Thread thread = new Thread(bootNettyServerRunnable);
        thread.start();
    }

    /**
     * static需要set注入
     */
    static BootNettyServerRunnable bootNettyServerRunnable;
    @Autowired
    private void setBootNettyServerRunnable( BootNettyServerRunnable bootNettyServerRunnable){
        MPApplicaton_01.bootNettyServerRunnable = bootNettyServerRunnable;
    }


}
